package com.util;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
@Data
@NoArgsConstructor
public class ResultEntity_wzl implements Serializable {
    private Integer code;
    private String msg;
    private Object data;
    public static ResultEntity_wzl ok(){
        ResultEntity_wzl result = new ResultEntity_wzl(200,"操作成功",null);
        return result;
    }

    public static ResultEntity_wzl ok(Object data){
        ResultEntity_wzl result = new ResultEntity_wzl(200,"操作成功",data);
        return result;
    }
    public static ResultEntity_wzl ok(String msg,Object data){
        ResultEntity_wzl result = new ResultEntity_wzl(200,msg,data);
        return result;
    }
    public static ResultEntity_wzl error(){
        ResultEntity_wzl result = new ResultEntity_wzl(500,"操作失败",null);
        return result;
    }
    public static ResultEntity_wzl error(Integer code){
        ResultEntity_wzl result = new ResultEntity_wzl(code,"操作失败",null);
        return result;
    }
    public static ResultEntity_wzl error(Integer code,String msg){
        ResultEntity_wzl result = new ResultEntity_wzl(code,msg,null);
        return result;
    }
    public ResultEntity_wzl(Integer code,String msg,Object data){
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}
